<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>editorGrd.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
     <link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-all.css">
  <script type="text/javascript" src="../ext/adapter/ext/ext-base.js"></script>
  <script type="text/javascript" src="../ext/ext-all.js"></script>
  <script type="text/javascript" src="../jquery/jquery-1.2.6.js"></script>
  </head>
  
  <body>
    <div id="hello" style="margin-left: 100px"></div>
    <select id="selectList">
      <option value="1">男</option>
      <option value="2">女</option>
    </select>
  </body>
  <script type="text/javascript">
     var data = [
       {id:"1",name:"zs1",sex:"nv",borndate:"1998-12-2"},
       {id:"2",name:"zs2",sex:"nv",borndate:"1997-3-4"},
       {id:"3",name:"zs3",sex:"nv",borndate:"1985-4-23"}
     ];
     var store = new Ext.data.JsonStore(
          {data:data,fields:["id","name","sex",{name:"borndate",type:"date",dateFormat:"Y-n-j"}]});
     
     var store1 = new Ext.data.Store({
       url:"searchGridData.action",
       reader: new Ext.data.JsonReader({type:"json"},["id","name","sex",{name:"borndate",type:"date",dateFormat:"Y-n-j"}])
     });
     var colM = new Ext.grid.ColumnModel([
     {
       header:"编号",
       dataIndex: "id"
     },
     {
        header:"姓名",
        dataIndex:"name",
        editor: new Ext.form.TextField()
       
        
      },
      {
        header: "性别",
        dataIndex: "sex",
        editor: new Ext.form.ComboBox({transform:"selectList",triggerAction:"all",lazyRender:true})
      },
      {
        header: "出生日期",
        dataIndex: "borndate",
        renderer: new Ext.util.Format.dateRenderer("Y年m月d日"),
        editor: new Ext.form.DateField({format:'年m月d日'}),
        width: 120
      }
     ]);
     
     $.ajax({
        url:"/user/searchGridData.action",
        type:"text",
       success: function(result){
         alert(result);
       }
     });
     Ext.onReady(function(){
        var grd = new Ext.grid.EditorGridPanel({
          renderTo: "hello",
          title: "test",
          width: 500,
          height: 300,
          cm:colM,
          store: store1,
          clicksToEdit: 1
        });
        store1.load();
     });
  </script>
</html>
